package chinese.admin.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;

import chinese.admin.domain.ChnArticleType;
/**
 * <p>数据访问类</p>
 * <p>Table: ChnArticleType</p>
 *
 */
 @DAO
public interface ChnArticleTypeDAO {

	@SQL("SELECT * FROM ChnArticleType WHERE deleteFlag=1 LIMIT :t.start,:t.length")
	List<ChnArticleType> query(@SQLParam("t")ChnArticleType obj);

	@ReturnGeneratedKeys
	@SQL("INSERT INTO ChnArticleType(name,deleteFlag,createAt,createUser,updateAt,updateUser) VALUES(:t.name,:t.deleteFlag,:t.createAt,:t.createUser,:t.updateAt,:t.updateUser)")
	int create(@SQLParam("t")ChnArticleType obj);
	
	@SQL("UPDATE ChnArticleType SET name=:t.name,deleteFlag=:t.deleteFlag,createAt=:t.createAt,createUser=:t.createUser,updateAt=:t.updateAt,updateUser=:t.updateUser WHERE id=:t.id")
	void update(@SQLParam("t")ChnArticleType obj);
	
	@SQL("UPDATE ChnArticleType SET deleteFlag=1 WHERE id=:1")
	void delete(int id);

}